p = 999999 # 设置相对较大的数，减少冲突
value = ['']*p # 哈希表
buffer = ['']*p # 溢出区
buffer_number = 0 # 溢出区的个数


def insTable(name):
    global buffer_number
    n = hash(name)%p
    if value[n] == name: # 不用插入
        return False
    elif value[n] == "":
        value[n] = name
        return True
    else:
        for i in range(buffer_number):
            if buffer[i] == name:
                return False
        # 过循环 --> 要增加溢出区元素个数
        buffer[buffer_number] = name
        buffer_number += 1
        return True

if __name__ == '__main__':
    n = int(input())
    while n >0:
        n-=1
        res = 'NO'
        word = input() # 输入单词
        flag = insTable(word) # flag判断是否插入成功，插入成功：1，插入失败（重复）：0
        if not flag: # 重复
            res = word # 结果替换，跳出循环
            break

    print(res)